<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<!--<![endif]-->
<!-- BEGIN HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
<!-- BEGIN PAGE CONTENT-->
<div class="site_content">
    <div class="realtime_content content_box no_table_filter">
        <div>
            <form class="instruct_box" id="form_id" method="post">
                <hr />
                <div>
                <div class="form-group form1 row">
                        <div class="col-sm-6">
                            <label class="col-sm-4">设备地址</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" id="chargerId" name="chargerId"  placeholder="请输入16位设备地址">
                            </div>
                            <span id="chargerInner"></span>
                        </div>
                </div>
                    <div class="form-group form1 row">

                        <div class="col-sm-6">
                            <label class="col-sm-4">用户卡号</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" id="userCard" name="userCard" placeholder="请输入20位用户卡号">
                            </div>
                            <span id="userInner"></span>
                        </div>
                    </div>

                   <div class="form-group form1 row">

                        <div class="col-sm-6">
                            <label class="col-sm-4">充电流水号</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" id="chargeStartSerialNumber" name="chargeStartSerialNumber"  placeholder="请输入18位充电流水号">
                            </div>
                            <span id="numberInner"></span>
                        </div>
                    </div>

                </div>
                <div class="modal-footer t_c" style="text-align: right;width: 520px">
                    <button style="margin-bottom:0" type="reset" class="btn btn-warning" data-dismiss="modal"><i class="fa fa-refresh"></i> 重置</button>
                    <button type="button" class="btn btn-primary"><i class="fa fa-check-circle-o"></i>停止充电</button>
                </div>
            </form>
        </div>
    </div>
</div>
<!-- END PAGE CONTENT-->
</body>
<script type="text/javascript">
         $('button.btn-primary').on('click',function(){
            var charger = $('#chargerId').val();
            var user = $('#userCard').val();
            var number = $('#chargeStartSerialNumber').val();
            if(!!charger && !!user && !!number){
                $.ajax({
                type:'post',
                url:'/oms/chargeControll/stopCharge',
                data:$('#form_id').serialize(),
                dataType: "json",
                async: false,
                success:function(data){
                    if(data.code == '200'){
                        bootboxWindow.alert("指令下发成功!", null);
                    }else{
                        bootboxWindow.alert("指令下发失败!", null);
                        $('#account').val('');
                        $('#password').val('');
                    }
                },
                error:function(){
                    bootboxWindow.alert("连接服务器失败",null);             
                }
        })
            }else{
                bootboxWindow.alert('关键字段不能为空');
            }
            

           

        });
</script>
</html>
